package com.ytg.myapplication;

import android.os.Bundle;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import android.widget.Toast;

import com.ytg.myanno.BindView;
import com.ytg.myanno.OnClick;
import com.ytg.myapplication.databinding.ActivityMainBinding;

public class MainActivity extends BaseAct<MainActivity$$Injector, ActivityMainBinding> {
    @BindView(value = R.id.mTvtitle, key = "title")
    TextView mTvtitle;
    @BindView(value = R.id.mrg, key = "sex")
    CustomRG mrg;
//    @BindView(value = R.id.mrg2, key = "sex2")
//    RadioGroup mrg2;
    @BindView(value = R.id.mchbox, key = "box")
    CheckBox mchbox;
    @BindView(value = R.id.get)
    Button get;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setData("title", "ceshi");
        getData("title");
        mrg.addRb("1","男",true).addRb("0","女",false).build();
//        mrg.setOnCheckResp(new CustomRG.OnCheckResp() {
//            @Override
//            public void back(String id, String name, int position, int resid) {
//                Log.e("eeeeee",id+name+position);
//            }
//        });
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_main;
    }
    @OnClick({R.id.mTvtitle})
    void setTip() {
        setData("sex", "nv");
        //        vbd.mTvtitle.setText("vbd");
//        setData("box", "true");
    }
    @OnClick({R.id.get})
    void showTip() {
        Toast.makeText(this, getData().toString(), Toast.LENGTH_SHORT).show();

    }
}